home *** CD-ROM | disk | FTP | other *** search
- Path: axe.netdoor.com!news
- From: esargent@netdoor.com (Eric Sargent)
- Newsgroups: comp.lang.c
- Subject: Re: Strcat Doesn't work for this?
- Date: Fri, 12 Jan 1996 20:29:27 GMT
- Organization: Internet Doorway, Inc.
- Message-ID: <4d6g8d$ouq@axe.netdoor.com>
- References: <Pine.SOL.3.91.960111151925.25068C-100000@lore.cs.purdue.edu>
- NNTP-Posting-Host: port91.netdoor.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- ** Craig Cook ** <cookca@cs.purdue.edu> wrote:
-
- >Putword(int w, char *imageChar)
- >{
- > w = (w & 0xff);
- > strcat( imageChar, (const char *)w );
-
- >}
-
- Looks as though you are passing a pointer with a range of 0-255, where
- you want to pass a pointer that points to w. Try:
-
- strcat(imageChar, (const char *)&w);
-
- Cast the address of w to char *, not cast value of w to char *.
-
-
-
-